package mapper

import (
	"com.yy.api/server/models"
	"strings"
)

type ImageMapper interface {
	GenericMapper[models.ImageBasic]
	ListRowImage() (string, error)
}

type ImageMapperImpl struct {
	*GenericMapperImpl[models.ImageBasic]
}

func (m *ImageMapperImpl) ListRowImage() (string, error) {
	var rowImageList []string
	err := m.DB.Model(&models.ImageBasic{}).Pluck("RowImage", &rowImageList).Error
	return strings.Join(rowImageList, ","), err
}
